package com.test.controller;

import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;

import com.test.entities.Barber;
import com.test.entities.Employee;

public class UserController extends SimpleFormController {

//	private UserService userService;

	public UserController()	{
		setCommandClass(Employee.class);
		setCommandName("employee");
	}
	
//	public void setUserService(UserService userService) {
//		this.userService = userService;
//	}

	@Override
	protected ModelAndView onSubmit(Object command) throws Exception {
		Employee employee = (Employee) command;
		System.out.println("Employee added successfully");
		return new ModelAndView("employeeSuccess","employee",employee);
	}
	
}